package cn.iocoder.yudao.module.enterprise.dal.mysql.praxisProjectSchedule;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.enterprise.controller.admin.praxisProject.vo.EnterpriseProjectScheduleVO;
import cn.iocoder.yudao.module.enterprise.dal.dataobject.praxisProjectSchedule.EnterpriseProjectScheduleDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 项目赛程安排 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface EnterpriseProjectScheduleMapper extends BaseMapperX<EnterpriseProjectScheduleDO> {


    default List<EnterpriseProjectScheduleDO> selectList(EnterpriseProjectScheduleVO reqVO) {
        return selectList(new LambdaQueryWrapperX<EnterpriseProjectScheduleDO>()
                .eqIfPresent(EnterpriseProjectScheduleDO::getScheduleType, reqVO.getScheduleType())
                .eqIfPresent(EnterpriseProjectScheduleDO::getProjectId, reqVO.getProjectId())
                .orderByDesc(EnterpriseProjectScheduleDO::getScheduleType));
    }

    List<EnterpriseProjectScheduleVO> getScheduleListByProjectId(@Param("projectId") Long projectId);
}
